<layout name="layout" />

        <div class="panel-body p-0">
            <div class="vertical-box">

                <div class="calender-box">
                    <div id="calendar"></div>
                </div>
                </div>
            </div>
        </div>




<!-- ================== BEGIN BASE JS ================== -->
<script src="__PUBLIC__/Common/html/assets/plugins/jquery/jquery-1.9.1.min.js"></script>
<script src="__PUBLIC__/Common/html/assets/plugins/jquery/jquery-migrate-1.1.0.min.js"></script>
<script src="__PUBLIC__/Common/html/assets/plugins/jquery-ui/ui/minified/jquery-ui.min.js"></script>
<script src="__PUBLIC__/Common/html/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="__PUBLIC__/Common/html/assets/crossbrowserjs/html5shiv.js"></script>
<script src="__PUBLIC__/Common/html/assets/crossbrowserjs/respond.min.js"></script>
<script src="__PUBLIC__/Common/html/assets/crossbrowserjs/excanvas.min.js"></script>
<![endif]-->
<script src="__PUBLIC__/Common/html/assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__PUBLIC__/Common/html/assets/plugins/jquery-cookie/jquery.cookie.js"></script>
<!-- ================== END BASE JS ================== -->

<!-- ================== BEGIN PAGE LEVEL JS ================== -->
<script src="__PUBLIC__/Common/fullcalendar/fullcalendar.js"></script>
<script src="__PUBLIC__/Common/html/assets/js/calendar.demo.min.js"></script>
<script src="__PUBLIC__/Common/html/assets/js/apps.min.js"></script>
<!-- ================== END PAGE LEVEL JS ================== -->
<script>
    $(document).ready(function() {
        $('#calendar').fullCalendar({
                buttonText: {
                    today: '今天',
                    month: '按月查看',
                    week: '按周查看',
                    day: '按天查看'
                },
                allDayText: "全天",
                timeFormat: {
                    '': 'H:mm '
                },
                weekMode: "variable",
                columnFormat: {
                    month: 'dddd',
                    week: 'dddd M-d',
                    day: 'dddd M-d'
                },
                titleFormat: {
                    month: 'yyyy年 MMMM月',
                    week: "[yyyy年] MMMM月d日 ",
                    day: 'yyyy年 MMMM月d日 dddd'
                },
                monthNames: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
                dayNames: ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
                header: {
                    left: 'prev,next today',
                    center: 'title',
                    right: 'month,agendaWeek,agendaDay'
                },
                events:[
                <foreach name="data" item="v">
                {
                    "id":"{$v['id']}",
                    "title":"{:$v['time']}"+'\n'+"<?php getIdByName('course',$v['course_id'],'course_name'); ?>"+'\n'+'{:$v['teacher']}' +'\n' +'{:$v['classroom']})'+ '\n'+'({:$v['limit_num_last']}' + '/{:$v['limit_num']})',
                    "start":"{$v['course_date']}",
                    "end":"{$v['course_date']}",
                    "textColor":"red",
                    "content":"{$v['course_addr']}",
                    "backgroundColor":"{:$v['color']}",
                    "borderColor":"transparent"
                },
            </foreach>

        ],
        eventOrder: "id",
            eventClick: function(calEvent, jsEvent, view) {
            document.location = '{:U('CourseCalendar/edit')}'+'?id='+calEvent.id;
        },
        dayClick: function() {
            document.location = '{:U('CourseCalendar/add')}';
        },
        editable: true

    });

    });
   /* $(function() {
        $('#calendar').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            },
            firstDay:1,//每行第一天为周一
            editable: true,//可以拖动
            events: ''    //事件数据
        });
    });*/
</script>